package at.fhooe.im440.pandora.logic.entities;

import java.awt.Graphics2D;
import java.awt.geom.Point2D;

import at.fhooe.im440.core.Core;
import at.fhooe.im440.pandora.events.Event;
import at.fhooe.im440.pandora.events.KeyInputEvent;

public class Ship extends Entity implements KeyInputEvent.Listener {
	
	private at.fhooe.im440.pandora.graphic.Ship gameGraphic;
	
	public Ship(String name, float x, float y, int w, int h, Core c) {
		super(name, c);
		
		this.gameGraphic = new at.fhooe.im440.pandora.graphic.Ship(x,y,w,h);
	}

	@Override
	public Point2D getPosition() {
		return new Point2D.Float(gameGraphic.getX(), gameGraphic.getY());
	}
	

	public void render(Graphics2D g) {
		gameGraphic.draw(g);
	}
	
//	private void transformGraphics(Graphics2D g) {
//		gameGraphic.transform(g);
//	    g.rotate(rot, x+(w/2), y+(h/2));
//	}

	@Override
	public void notify(Event e) {
		
		String dir = e.getData();
		
		gameGraphic.setDir(dir);
		
		

		
	}

}
